<div id="addResourceStoreModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"
     xmlns:v-bind="http://www.w3.org/1999/xhtml">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-body">
                <h3 class="m-t-none m-b ">
                    <vc:i18n name="添加" namespace="addResourceStore"></vc:i18n>
                </h3>
                <div class="ibox-content">
                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="物品名称" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <input v-model.trim="addResourceStoreInfo.resName" type="text"
                                   :placeholder="vc.i18n('必填，请填写物品名称','addResourceStore')" class="form-control">
                        </div>
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="物品编码" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <input v-model.trim="addResourceStoreInfo.resCode" type="text"
                                   :placeholder="vc.i18n('必填，请填写物品编码','addResourceStore')" class="form-control">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="物品类型" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <select class="custom-select" v-model="addResourceStoreInfo.parentRstId"
                                    @change="resourceStoreTypesOnChangeAdd">
                                <option selected disabled value="">
                                    {{vc.i18n('必填，请选择物品类型','addResourceStore')}}
                                </option>
                                <option v-for="(item,index) in addResourceStoreInfo.resourceStoreTypes" :key="index"
                                        v-bind:value="item.rstId">{{item.name}}
                                </option>
                            </select>
                        </div>
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="二级分类" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <select class="custom-select" v-model="addResourceStoreInfo.rstId"
                                    @change="sonResourceStoreTypesOnChangeAdd">
                                <option selected disabled value="">
                                    {{vc.i18n('必填，请选择二级分类','addResourceStore')}}
                                </option>
                                <option v-for="(item,index) in addResourceStoreInfo.sonResourceStoreTypes" :key="index"
                                        v-bind:value="item.rstId">{{item.name}}
                                </option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="物品单位" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <select class="custom-select" v-model="addResourceStoreInfo.unitCode">
                                <option selected disabled value="">
                                    {{vc.i18n('必填，请选择物品单位','addResourceStore')}}
                                </option>
                                <option v-for="(item,index) in addResourceStoreInfo.unitCodes" :key="index"
                                        v-bind:value="item.statusCd">{{item.name}}
                                </option>
                            </select>
                        </div>
                        <label class="col-sm-2 col-form-label  text-right">
                            <vc:i18n name="固定物品" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <select class="custom-select" v-model="addResourceStoreInfo.isFixed">
                                <option selected disabled value="">
                                    {{vc.i18n('必填，请选择是否是固定物品','addResourceStore')}}
                                </option>
                                <option v-for="(item,index) in addResourceStoreInfo.isFixeds" :key="index"
                                        v-bind:value="item.statusCd">{{item.name}}
                                </option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="物品规格" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <select class="custom-select" v-model="addResourceStoreInfo.rssId">
                                <option selected value="">
                                    {{vc.i18n('选填，请选择物品规格','addResourceStore')}}
                                </option>
                                <option v-for="(item,index) in addResourceStoreInfo.resourceStoreSpecifications"
                                        :key="index" v-bind:value="item.rssId">{{item.specName}}
                                </option>
                            </select>
                        </div>
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="仓库" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <select class="custom-select" v-model="addResourceStoreInfo.shId">
                                <option selected disabled value="">
                                    {{vc.i18n('必填，请选择仓库','addResourceStore')}}
                                </option>
                                <option v-for="(item,index) in addResourceStoreInfo.storehouses" :key="index"
                                        v-bind:value="item.shId">{{item.shName}}
                                </option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="参考价格" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <input v-model.trim="addResourceStoreInfo.price" type="text"
                                   :placeholder="vc.i18n('必填，请填写物品采购参考价格','addResourceStore')" class="form-control">
                        </div>
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="警告库存" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <input v-model.trim="addResourceStoreInfo.warningStock" type="text"
                                   :placeholder="vc.i18n('必填，请填写警告库存','addResourceStore')" class="form-control">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="最小计量单位" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <select class="custom-select" v-model="addResourceStoreInfo.miniUnitCode">
                                <option selected disabled value="">
                                    {{vc.i18n('必填，请选择物品最小计量单位','addResourceStore')}}
                                </option>
                                <option v-for="(item,index) in addResourceStoreInfo.unitCodes" :key="index"
                                        v-bind:value="item.statusCd">{{item.name}}
                                </option>
                            </select>
                            <span class="help-block">【例】1盒钉子50个，物品单位为盒（1盒）， 最小计量单位为个（50个）。</span>
                        </div>
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="最小计量数量" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4 text-right">
                            <input v-model.trim="addResourceStoreInfo.miniUnitStock" type="text"
                                   :placeholder="vc.i18n('必填，请填写最小计量单位数量','addResourceStore')" class="form-control">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="最低收费标准(最小计量单位)" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <input v-model.trim="addResourceStoreInfo.outLowPrice" type="text"
                                   :placeholder="vc.i18n('必填，请填写物品最小计量单位，最低收费标准','addResourceStore')"
                                   class="form-control">
                        </div>
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="最高收费标准(最小计量单位)" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <input v-model.trim="addResourceStoreInfo.outHighPrice" type="text"
                                   :placeholder="vc.i18n('必填，请填写物品最小计量单位，最高收费标准','addResourceStore')"
                                   class="form-control" @change="decideAdd()">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="初始库存" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <input v-model.trim="addResourceStoreInfo.stock" type="text"
                                   :placeholder="vc.i18n('必填，请填写出入库存','addResourceStore')" class="form-control">
                        </div>
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="备注" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <textarea :placeholder="vc.i18n('选填，请填写备注','addResourceStore')" class="form-control"
                                      v-model.trim="addResourceStoreInfo.remark">
                            </textarea>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="描述" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <textarea :placeholder="vc.i18n('选填，请填写描述','addResourceStore')" class="form-control"
                                      v-model.trim="addResourceStoreInfo.description">
                            </textarea>
                        </div>
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="上传图片" namespace="addResourceStore"></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <vc:create path="frame/uploadImageUrl" callBackListener="addResourceStore"
                                       callBackFunction="notifyUploadImage" namespace="addResourceStore">
                            </vc:create>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <button class="btn btn-primary float-right" type="button" v-on:click="saveResourceStoreInfo()">
                            <i class="fa fa-check"></i>&nbsp;保存
                        </button>
                        <button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
                                data-dismiss="modal">
                            <i class="fa fa-times"></i>&nbsp;取消
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>